const { override, fixBabelImports, addWebpackAlias } = require("customize-cra");
const path = require("path");
// function resolve(dir) {
//   return path.join(__dirname, ".", dir);
// }
module.exports = override(
  // 配置路径别名
  addWebpackAlias({
    '@assets': path.resolve(__dirname, "src/assets"),
    '@css': path.resolve(__dirname, "src/assets/css"),
    '@img': path.resolve(__dirname, "src/assets/img"),
    '@component': path.resolve(__dirname, "src/component"),
    '@router': path.resolve(__dirname, "src/router"),
    '@views': path.resolve(__dirname, "src/views")
  }),
  // antd按需加载
  fixBabelImports("import", {
    libraryName: "antd-mobile",
    style: "css",
  })
);
